import Http from './http.js'

// 测试域名 http://btprint.yongshantuan.cn:8085  https://btprint.yongshantuan.cn:8085
// 正式域名 https://btprint.yongshantuan.cn:3389
let http = new Http('https://customer.qiyetuancan.com:8085');
//  https://employee.enterprise.qiyetuancan.com:9091
let http1 = new Http('https://enterprise.qiyetuancan.com:9091');

// 登录
function login(params) {
	return http.request('/jeecg-boot/jx/jxUser/loginForWx', params)
}

//退出登录
function logoutForWx(params) {
	return http1.request("/employee/indexPage/logout",params)
}

// 手机号码登录
function wxLogin(params){
	// let wxAuthorizeCode = params.data.wxAuthorizeCode;
	// params.data = {};
	
	return http1.request('/employee/indexPage/loginWx',params)
	// return http.request('/jeecg-boot/jx/enterprise/user/loginWx', params)
}

// 账号密码登录
function loginUserPassword(params){
	return http1.request('/employee/indexPage/loginUserPassword', params)
}


// 获取首页背景图，轮播图，用户昵称，余额，优惠券，积分等信息
function queryWelcomePageData(params) {
	// return http.request('/jeecg-boot/jx/jxWelcomePage/queryWelcomePageData', params)
	return http1.request('/employee/indexPage/queryUserInfoAndCompanyInfoByUserId', params)
}

// 根据店铺名或菜品名进行模糊搜索
function queryStoresByKeyword(params) {
	return http1.request('/employee/orderPage/queryAssociatedStoresByKeyword', params)
}


// 店铺详情 菜品分类
function queryStoreDetail(params) {
	return http1.request('/employee/orderPage/queryStoreDetailsOfCompanyMenu', params)
}

// 购物车列表
function queryShoppingCart(params) {
	return http1.request("/employee/orderPage/queryShoppingCart", params);
}
// 

// 向购物车添加菜品
function addShoppingCart(params) {
	return http1.request('/employee/orderPage/addShoppingCart', params)
}

// 移除购物车菜品
function removeShoppingCart(params) {
	return http1.request('/employee/orderPage/removeShoppingCart', params)
}

// 根据用户id 获取用户地址
function queryUserPickUpAddress(params) {
	return http1.request("/employee/AboutMePage/queryUserPickupAddressInfo", params)
}


// 修改密码
function changePassword(params) {
	return http1.request("/employee/AboutMePage/changePassword", params)
}


// 我的订单中心  // 获取各种状态订单的数量
function getCenterGoods(params) {
	return http1.request('/employee/AboutMePage/queryOrderStatisticInfo', params)
}

//取消订单
function getqueryOrderDetailsqx(params) {
	return http1.request("/employee/orderPay/cancelOrder", params)
}

//  店铺内根据搜索条件返回符合条件的菜品
function queryFoodsByKeyword(params) {
	return http.request('/jeecg-boot/jx/jxStore/queryFoodsByKeyword', params)
	// return http1.request('/employee/orderPage/queryFoodsByKeyword', params)
}

// 再来一点 ，去支付
function queryOrderDetailWhenTryAgain(params) {
	return http1.request("/employee/orderPay/createOrderAgain", params)
}

// 去支付
function topayInfo(params) {
	return http1.request("/employee/orderPay/toPay", params)
}



// 下单 
function createOrder(params) {
	// return http.request("/jeecg-boot/jx/jxOrderPay/createOrder", params)
	return http1.request("/employee/orderPay/createOrder", params)
}


//获取订单列表数据
function getGoodList(params) {
	// return http.request('/jeecg-boot/jx/jxOrder/queryOrderDetailsByType', params)
	return http1.request('/employee/AboutMePage/queryOrdersByStatus', params)
}


//提交评论
function sumitPlFn(params) {
	return http.request("/jeecg-boot/jx/jxOrder/submitOrderReview", params)
}


//上传图片
function pinLunFn(params) {
	return http.request("/jeecg-boot/jx/imageUpload/upload", params, 'file')
}
// 获取售后类型及赔偿金额
function setPayFn(params) {
	return http.request("/jeecg-boot/jx/jxOrder/queryAfterSaleServiceRules", params)
}
// 订单发起售后申请，提交售后内容
function submitAfter(params) {
	return http.request("/jeecg-boot/jx/jxOrder/submitAfterSaleService", params)
}
// 查看售后进度
function setStape(params) {
	return http.request("/jeecg-boot/jx/jxOrder/queryAfterSaleProcess", params)
}


// 佣金明细
function getYjdetalFn(params) {
	return http.request("/jeecg-boot/jx/jxPromotion/queryPromotionCommissionDetails", params)
}






// 轮播图
function queryCarouselChartlmages(params) {
	return http.request('/jeecg-boot/jx/jxSiteAddressDetails/queryCarouselChartImages', params)
}

//展示店铺分类
function queryStoreCategory(params) {
	return http.request('/jeecg-boot/jx/jxStore/queryStoreCategories', params)
}



// 根据站点id获取站点下的大厦列表和按钮icon图标
function queryBuildingBriefInfoBySiteId(params) {
	return http.request('/jeecg-boot/jx/jxOrder/queryBuildingBriefInfoBySiteId', params)
}


// 根据楼栋名称获取取餐点照片列表
function queryPickupAddressImagesByBuildingName(params) {
	return http.request('/jeecg-boot/jx/jxOrder/queryPickupAddressImagesByBuildingName', params)
}

// 根据店铺类型，返回店铺列表
function queryStoresByCategoriyId(params) {
	return http.request('/jeecg-boot/jx/jxStore/queryStoresByCategoriyId', params)
}


// 获取当前已下单用户数量
function queryTotalOrderCount(params) {
	return http.request('/jeecg-boot/jx/jxOrder/queryPayedOrderCount', params)
}


// 大厦点餐倒计时
function querySiteAddressSupplyTimeSpan(params) {
	return http.request('/jeecg-boot/jx/jxSiteAddressDetails/querySiteSupplyTimeSpan', params)
}


// 根据经纬度  计算最匹配的大厦
function queryNearnestSiteAddrByLongLat(params) {
	return http.request('/jeecg-boot/jx/jxSiteAddressDetails/queryNearnestSiteAddrByLongLat', params)
}

// 
//  查询用户选择的大厦
function queryUserAddress(params) {
	return http.request('/jeecg-boot/jx/jxSiteAddressDetails/queryUserAddress', params)
}

// 返回所有可供选择的大厦列表
function queryAllSiteAddress(params) {
	return http.request('/jeecg-boot/jx/jxSiteAddressDetails/queryAllSiteAddress', params)
}



//  店铺内根据菜品分类获取菜品列表
function queryFoodByType(params) {
	return http.request('/jeecg-boot/jx/jxStore/queryFoodByType', params)
}



// 查看购物车菜品
function sendPageViewEvent(params) {
	return http.request('/jeecg-boot/jx/jxUser/sendPageViewEvent', params)
}

//获取用户信息
function getUserInfoFn(params) {
	return http.request('/jeecg-boot/jx/jxUser/queryUserBasicInfo', params)
}


// 下单页面 查询可用余额和积分及积分可抵扣金额
function queryWalletBalanceAndPoints(params) {
	return http.request('/jeecg-boot/jx/jxOrderPay/queryWalletBalanceAndPoints', params)
}





// 领取优惠券
function receiveCoupon(params) {
	return http.request("/jeecg-boot/jx/jxCoupon/receiveCoupon", params)
}

// 已领取优惠券
function chooseBestCoupon(params) {
	return http.request("/jeecg-boot/jx/jxCoupon/chooseBestCoupon", params)
}

// 选择地址
function querySupplyAddress(params) {
	return http.request("/jeecg-boot/jx/jxAboutMe/querySupplyAddress", params)
}

//获取优惠券
function getCoupnsInfo(params) {
	return http.request("/jeecg-boot/jx/jxCoupon/queryUserCouponsByType", params)
}

//获取我的推广概览
function getTgInfo(params) {
	return http.request("/jeecg-boot/jx/jxPromotion/queryMyPromotionSummary", params)
}


//获取提现佣金
function getTotalNum(params) {
	return http.request("/jeecg-boot/jx/jxPromotion/queryWithdrawRecords", params)
}



//立即提现
function txFn(params) {
	return http.request("/jeecg-boot/jx/jxPromotion/withdrawPromotionFee", params)
}



// 更新用户地址
function saveUserPickupAddress(params) {
	return http.request("/jeecg-boot/jx/jxUser/saveUserPickupAddress", params)
}



// 获取推广名片二维码 
function queryShareQRCode(params) {
	return http.request("/jeecg-boot/jx/jxPromotion/queryShareQRCode", params)
}

// 用户通过分享码打开小程序，将分享者的id传递给后台，建立分享者与新用户之间的关联
function sendSharedUserId(params) {
	return http.request("/jeecg-boot/jx/jxPromotion/sendSharedUserId", params)
}


// 新手大礼包 查询是否为新用户
function checkNewUserCouponPackage(params) {
	return http.request("/jeecg-boot/jx/jxCoupon/checkNewUserCouponPackage", params)
}

// 领取新手大礼包
function receiveNewUserCouponPackage(params) {
	return http.request("/jeecg-boot/jx/jxCoupon/receiveNewUserCouponPackage", params)
}




// 获取余额详情
function queryWalletTransactions(params) {
	return http.request("/jeecg-boot/jx/jxWallet/queryWalletTransactions", params)
}

// 获取订单详情
function queryOrderDetailById(params) {
	return http.request("/jeecg-boot/jx/jxOrder/queryOrderDetailById", params)
}

//充值 
function recharge(params) {
	return http.request("/jeecg-boot/jx/jxWallet/recharge", params)
}

// 查看充值活动
function queryReChargeActivities(params) {
	return http.request("/jeecg-boot/jx/jxWallet/queryReChargeActivities", params)
}

// 新接口  下单页面公司取餐地址信息 
function queryCompanyPickUpAddressInfos(params){
	return http.request("/employee/orderPage/queryCompanyPickUpAddressInfos", params)
}

// 新接口  下单页面根据搜索条件 查询为该公司配置的，符合菜品搜索条件的店铺 
function queryAssociatedStoresByKeyword(params){
	return http.request("/employee/orderPage/queryAssociatedStoresByKeyword", params)
}



//  /jxtc/enterprise/orderManage/queryOrderByPage

export {
	login,
	wxLogin,
	loginUserPassword,
	queryStoreCategory,
	queryStoresByKeyword,
	queryBuildingBriefInfoBySiteId,
	queryPickupAddressImagesByBuildingName,
	queryStoresByCategoriyId,
	queryTotalOrderCount,
	queryWelcomePageData,
	queryCarouselChartlmages,
	querySiteAddressSupplyTimeSpan,
	queryShoppingCart,
	queryNearnestSiteAddrByLongLat,
	queryUserAddress,
	queryAllSiteAddress,
	queryStoreDetail,
	queryFoodsByKeyword,
	queryFoodByType,
	addShoppingCart,
	removeShoppingCart,
	sendPageViewEvent,
	getCenterGoods,
	createOrder,
	getUserInfoFn,
	getGoodList,
	queryWalletBalanceAndPoints,
	receiveCoupon,
	chooseBestCoupon,
	querySupplyAddress,
	getCoupnsInfo,
	getTgInfo,
	getTotalNum,
	getqueryOrderDetailsqx,
	queryOrderDetailWhenTryAgain,
	txFn,
	topayInfo,
	queryUserPickUpAddress,
	saveUserPickupAddress,
	queryShareQRCode,
	sendSharedUserId,
	checkNewUserCouponPackage,
	receiveNewUserCouponPackage,
	sumitPlFn,
	pinLunFn,
	setPayFn,
	submitAfter,
	setStape,
	getYjdetalFn,
	logoutForWx,
	queryWalletTransactions,
	queryOrderDetailById,
	recharge,
	queryReChargeActivities,
	queryCompanyPickUpAddressInfos,
	queryAssociatedStoresByKeyword,
	changePassword
}